<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var str = 'absaasdffgghhjjkkgfddsssss34443433';
        console.log(str.length);
        console.log(str.charAt(0));
        console.log(str.indexOf('a'));
        while (str.indexOf('g') !== -1 || str.indexOf('ss') !== -1) {
            str = str.replace('g', '22');
            str = str.replace('ss', 'b');
        }
        console.log(str);
        str = str.substr(0, 3);
        console.log(str);

        var str = 'absaasdffgghhjjkkgfddsssss34443433';
        var obj = {};
        for (var i = 0; i < str.length; i++) {
            var key = str[i];
            if (obj[key]) {
                obj[key]++;
            } else {
                obj[key] = 1;
            }
        }
        console.log(obj);

        var max = 0;
        var maxkey;
        for (const key in obj) {
            if (obj[key] > max) {
                max = obj[key];
                maxkey = key;
            }
        }
        console.log(maxkey, max);
    </script>
</head>

<body>

</body>

</html>